package com.feilong.modules.dao.order;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feilong.modules.model.order.po.OrderInfoPO;
import com.feilong.modules.model.order.request.OrderInfoRequest;
import com.feilong.modules.model.order.vo.GoodsListVO;
import com.feilong.modules.model.order.vo.OrderInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderInfoDao extends BaseMapper<OrderInfoPO> {

    /**
     * 获取订单列表
     * @param query
     * @param page
     */
    List<OrderInfoVO> getOrderInfo(@Param("query") OrderInfoRequest query, @Param("page") Page<OrderInfoVO> page);

    /**
     * 根据订单id获取订单商品列表
     * @param id
     */
    List<GoodsListVO> getOrderGoodsList(Long id);

    /**
     * 添加主表信息,并获取自增id
     * @param orderInfo
     */
    void insertOrderInfo(OrderInfoPO orderInfo);
}
